using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Routing;

namespace RB2012
{
	// Note: For instructions on enabling IIS6 or IIS7 classic mode, 
	// visit http://go.microsoft.com/?LinkId=9394801

	public class MvcApplication : System.Web.HttpApplication
	{
		public static void RegisterGlobalFilters(GlobalFilterCollection filters)
		{
			filters.Add(new HandleErrorAttribute());
		}

		public static void RegisterRoutes(RouteCollection routes)
		{
			routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            	routes.MapRoute(
                	"Account", // Route name
                	"Account/{action}", // URL with parameters
                	new { controller = "Account", action = "LogOn", id = UrlParameter.Optional } // Parameter defaults
            	);

            	routes.MapRoute(
                	"Admin", // Route name
                	"Admin/{action}/{id}", // URL with parameters
                	new { controller = "Admin", action = "Index", id = UrlParameter.Optional } // Parameter defaults
            	);
            
            	routes.MapRoute(
			"Mobile", // Route name
			"Mobile/{action}", // URL with parameters
			new { controller = "Mobile", action = "Index", id = UrlParameter.Optional } // Parameter defaults
		);

			routes.MapRoute(
				"ASPMVCForm", // Route name
				"ASPMVCForm/{action}", // URL with parameters
				new { controller = "ASPMVCForm", action = "Index", id = UrlParameter.Optional } // Parameter defaults
			);

			routes.MapRoute(
				"StyleForm", // Route name
				"StyleForm/{action}", // URL with parameters
				new { controller = "StyleForm", action = "Index", id = UrlParameter.Optional } // Parameter defaults
			);

			routes.MapRoute(
				"CSSPrint", // Route name
				"CSSPrint", // URL with parameters
				new { controller = "CSSPrint", action = "Index", id = UrlParameter.Optional } // Parameter defaults
			);

			routes.MapRoute(
				"CSSLayout", // Route name
				"CSSLayout/{action}", // URL with parameters
				new { controller = "CSSLayout", action = "Index", id = UrlParameter.Optional } // Parameter defaults
			);

			routes.MapRoute(
				"Default", // Route name
				"{action}", // URL with parameters
				new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
			);
			
			//routes.MapRoute(
            		//"Default",//route name
            		//"{controller}/{action}/{id}", //url with parameters
            		//new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
            		//);

		}

		protected void Application_Start()
		{
			AreaRegistration.RegisterAllAreas();

			RegisterGlobalFilters(GlobalFilters.Filters);
			RegisterRoutes(RouteTable.Routes);
		}
	}
}
